Use GSlice to allocate GtkPaperSize. Bug #434862.
authorChristian Persch <chpe@gnome.org>
Tue, 1 May 2007 22:26:00 +0000 (22:26 +0000)
committerChristian Persch <chpe@src.gnome.org>
Tue, 1 May 2007 22:26:00 +0000 (22:26 +0000)
2007-05-02  Christian Persch  <chpe@gnome.org>

* gtk/gtkpapersize.c: (gtk_paper_size_new_from_info),
(gtk_paper_size_new), (gtk_paper_size_new_custom),
(gtk_paper_size_copy), (gtk_paper_size_free): Use GSlice to allocate
GtkPaperSize. Bug #434862.

svn path=/trunk/; revision=17759

ChangeLog
gtk/gtkpapersize.c

index c5fa07ecee3953d96cf80b0d25b7769e05934547..27a7e6c9d1fe8ca81aad9a4640a9313cf3fc363a 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2007-05-02  Christian Persch  <chpe@gnome.org>
+
+       * gtk/gtkpapersize.c: (gtk_paper_size_new_from_info),
+       (gtk_paper_size_new), (gtk_paper_size_new_custom),
+       (gtk_paper_size_copy), (gtk_paper_size_free): Use GSlice to allocate
+       GtkPaperSize. Bug #434862.
+
 2007-05-02  Christian Persch  <chpe@gnome.org>
 
        * gtk/gtkstatusbar.c: (gtk_statusbar_get_context_id),
index 4536adbd254f24e15a8a82ed87f8d752961fae84..db6a34b98724a722016726a831d8f1d8d031041c 100644 (file)
@@ -1,6 +1,7 @@
 /* GTK - The GIMP Toolkit
  * gtkpapersize.c: Paper Size
  * Copyright (C) 2006, Red Hat, Inc.
+ * Copyright © 2006, 2007 Christian Persch
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
@@ -180,7 +181,7 @@ gtk_paper_size_new_from_info (const PaperInfo *info)
 {
   GtkPaperSize *size;
   
-  size = g_new0 (GtkPaperSize, 1);
+  size = g_slice_new0 (GtkPaperSize);
   size->info = info;
   size->width = info->width;
   size->height = info->height;
@@ -217,7 +218,7 @@ gtk_paper_size_new (const gchar *name)
   
   if (parse_full_media_size_name (name, &short_name, &width, &height))
     {
-      size = g_new0 (GtkPaperSize, 1);
+      size = g_slice_new0 (GtkPaperSize);
 
       size->width = width;
       size->height = height;
@@ -234,7 +235,7 @@ gtk_paper_size_new (const gchar *name)
       else
        {
          g_warning ("Unknown paper size %s\n", name);
-         size = g_new0 (GtkPaperSize, 1);
+         size = g_slice_new0 (GtkPaperSize);
          size->name = g_strdup (name);
          size->display_name = g_strdup (name);
          /* Default to A4 size */
@@ -349,7 +350,7 @@ gtk_paper_size_new_custom (const gchar *name,
   g_return_val_if_fail (name != NULL, NULL);
   g_return_val_if_fail (unit != GTK_UNIT_PIXEL, NULL);
 
-  size = g_new0 (GtkPaperSize, 1);
+  size = g_slice_new0 (GtkPaperSize);
   
   size->name = g_strdup (name);
   size->display_name = g_strdup (display_name);
@@ -376,7 +377,7 @@ gtk_paper_size_copy (GtkPaperSize *other)
 {
   GtkPaperSize *size;
 
-  size = g_new0 (GtkPaperSize, 1);
+  size = g_slice_new0 (GtkPaperSize);
 
   size->info = other->info;
   if (other->name)
@@ -407,7 +408,8 @@ gtk_paper_size_free (GtkPaperSize *size)
   g_free (size->name);
   g_free (size->display_name);
   g_free (size->ppd_name);
-  g_free (size);
+
+  g_slice_free (GtkPaperSize, size);
 }
 
 /**